Skip to content

Varinitsa#8

Open
Half-Head wants to merge 23 commits intoDafeCpp:mainfrom
Half-Head:main
Open

Varinitsa#8
Half-Head wants to merge 23 commits intoDafeCpp:mainfrom
Half-Head:main

Conversation

@Half-Head
Copy link
Copy Markdown
Contributor

KDtree in task 7

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 15 out of 31. Check the log or trigger a new build to see more.

Comment thread sandbox/template/src/main.cpp Outdated
Comment thread sandbox/template/src/main.cpp Outdated
Comment thread sandbox/template/src/main.cpp Outdated
for (int i = 0; i < unsort.size(); ++i) {
std ::cout << unsort[i] << " ";
}
std ::cout << std ::endl;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: do not use 'std ::endl' with streams; use '\n' instead [performance-avoid-endl]

Suggested change
std ::cout << std ::endl;
std ::cout << '\n';

@DafeCpp DafeCpp deleted a comment from github-actions Bot May 3, 2025
@DafeCpp DafeCpp deleted a comment from github-actions Bot May 3, 2025
@DafeCpp DafeCpp deleted a comment from github-actions Bot May 3, 2025
@DafeCpp DafeCpp deleted a comment from github-actions Bot May 3, 2025
@DafeCpp DafeCpp deleted a comment from github-actions Bot May 3, 2025
@DafeCpp DafeCpp deleted a comment from github-actions Bot May 3, 2025
@DafeCpp DafeCpp deleted a comment from github-actions Bot May 3, 2025
@DafeCpp DafeCpp deleted a comment from github-actions Bot May 3, 2025
@DafeCpp DafeCpp deleted a comment from github-actions Bot May 3, 2025
@DafeCpp DafeCpp deleted a comment from github-actions Bot May 3, 2025
@DafeCpp DafeCpp deleted a comment from github-actions Bot May 3, 2025
@DafeCpp DafeCpp deleted a comment from github-actions Bot May 3, 2025
@Half-Head Half-Head changed the title KDtree Varinitsa May 3, 2025
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 15 out of 27. Check the log or trigger a new build to see more.

Comment thread task_02/src/stack.hpp
#include <vector>

template <typename T>
concept Comparable = requires(T a, T b) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'T' does not refer to a value [clang-diagnostic-error]

concept Comparable = requires(T a, T b) {
                                   ^
Additional context

task_02/src/stack.hpp:5: declared here

template <typename T>
                   ^

Comment thread task_02/src/stack.hpp

template <typename T>
concept Comparable = requires(T a, T b) {
{ a < b } -> std::convertible_to<bool>;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'T' does not refer to a value [clang-diagnostic-error]

concept Comparable = requires(T a, T b) {
                              ^
Additional context

task_02/src/stack.hpp:5: declared here

template <typename T>
                   ^

Comment thread task_02/src/stack.hpp

template <typename T>
concept Comparable = requires(T a, T b) {
{ a < b } -> std::convertible_to<bool>;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: unknown type name 'concept' [clang-diagnostic-error]

concept Comparable = requires(T a, T b) {
^

Comment thread task_02/src/stack.hpp
};

template <Comparable T>
class Stack {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: unknown type name 'Comparable' [clang-diagnostic-error]

template <Comparable T>
          ^

Comment thread task_02/src/stack.hpp
void Push(int value);
int Pop();
void Push(T k);
T Pop();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: unknown type name 'T' [clang-diagnostic-error]

  void Push(T k);
            ^

Comment thread task_02/src/stack.hpp Outdated
Comment thread task_02/src/stack.hpp
T Stack<T>::Pop() {
if (_data.size() == 0) throw std::runtime_error("No data in stack");
T pop_val{_data.back()};
_data.pop_back();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: expected ';' after expression [clang-diagnostic-error]

Suggested change
T pop_val{_data.back()};
T; pop_val{_data.back()};

Comment thread task_02/src/stack.hpp
T Stack<T>::Pop() {
if (_data.size() == 0) throw std::runtime_error("No data in stack");
T pop_val{_data.back()};
_data.pop_back();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use of undeclared identifier 'pop_val' [clang-diagnostic-error]

  T pop_val{_data.back()};
    ^

Comment thread task_02/src/stack.hpp
T pop_val{_data.back()};
_data.pop_back();
return pop_val;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use of undeclared identifier 'pop_val' [clang-diagnostic-error]

  return pop_val;
         ^

Comment thread task_02/src/stack.hpp
}

template <Comparable T>
class MinStack {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: unknown type name 'Comparable' [clang-diagnostic-error]

template <Comparable T>
          ^

Comment thread sandbox/template/src/main.cpp Outdated

int main() { return 0; }
void MergeSort(std ::vector<int>& array) {
int i{0}, j{1};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

давай сделаем 1 строка одно объявление

Comment thread task_01/src/find.cpp Outdated
@@ -0,0 +1,20 @@
#include "find.hpp"

std ::vector<int> find_nums(int k, std ::vector<int> sequence) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FindNums хотя бы, или вообще лучше назвать как-то более понятно. какие числа мы находим, из названия не понятно.
возвращаем вектор из этого не понятно может мы возвращаем 3 числа, или 0, или просто измененный вектор

int k - тоже непонятное имя аргумента

const std ::vector& sequence - не нужно лишнее копирование

Comment thread task_01/src/find.cpp Outdated
std ::vector<int> find_nums(int k, std ::vector<int> sequence) {
if (sequence.size() == 0) throw no_sum_num{};

std ::vector<int> ans;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

answer, жалеко символов?) писать сложнее не станет, автодополнение работает почти везде)

Comment thread task_01/src/find.hpp Outdated
#include <string>
#include <vector>

struct no_sum_num {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

лучше наследоваться от std::exception:

Suggested change
struct no_sum_num {
class NoSumExist : public std::exception {
using std::exception::exception;
};

Comment thread task_02/src/stack.cpp Outdated
#include "stack.hpp"

#include <algorithm>
// template <typename T>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нехорошо что бы в исходном коде был закоментированный код, если только это не пример использования кода

вроде тут ничего нет кода, просто удали файл что бы глаза не мазолил

Comment thread task_02/src/stack.hpp Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

переименуй файл

Comment thread task_03/src/topology_sort.cpp Outdated

#include "warming_func.hpp"

std ::vector<int> warming(std ::vector<int> temperature) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

хотя бы Warming и то не очень понятно что это функция (обычно в имени функции глагол) и не очень понятно что она делает

Comment thread task_05/src/main.cpp Outdated
int main() { return 0; }
#include "sorting.hpp"

// template <typename T>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

выше писал про закоментированый код

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

далее тоже поправь таккие места, не буду писать комментарии об этом

Comment thread task_05/src/merge.cpp Outdated
// return ans;
// }

void MergeSort(std ::vector<int>& array) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это не сортировка слиянеием(

поправь потом посмотрю

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Comment thread task_02/src/stack.hpp
void Push(int value);
int Pop();
int GetMin();
void Push(T k);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: unknown type name 'T' [clang-diagnostic-error]

  void Push(T k);
            ^

Comment thread task_02/src/stack.hpp
int GetMin();
void Push(T k);
T Pop();
T GetMin();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: unknown type name 'T' [clang-diagnostic-error]

  T Pop();
  ^

Comment thread task_02/src/stack.hpp
void Push(T k);
T Pop();
T GetMin();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: unknown type name 'T' [clang-diagnostic-error]

  T GetMin();
  ^

Comment thread task_02/src/stack.hpp
private:
std::vector<int> data_;
std ::vector<T> _data;
std ::vector<T> _min_data;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: template argument for template type parameter must be a type [clang-diagnostic-error]

  std ::vector<T> _data;
               ^
Additional context

/usr/include/c++/13/bits/stl_vector.h:426: template parameter is declared here

  template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
                    ^

if (data.size() == 0) throw std::invalid_argument("");
if (n > data.size()) throw std::invalid_argument("");

MergeSort(data);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use of undeclared identifier 'MergeSort' [clang-diagnostic-error]

  MergeSort(data);
  ^

Comment thread task_07/src/main.cpp Outdated
KDTree tree(cloud);
std ::cout << "compiled\n";
Point k = tree.NearestPoint(Point(4.8, 5.9));
std ::cout << k.x << " " << k.y << std ::endl;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: do not use 'std ::endl' with streams; use '\n' instead [performance-avoid-endl]

Suggested change
std ::cout << k.x << " " << k.y << std ::endl;
std ::cout << k.x << " " << k.y << '\n';

Comment thread task_07/src/test.cpp

#include "KDtree.hpp"

std::vector<Point> GenerateRandomPoints(size_t count, double min = 0.0,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'GenerateRandomPoints' can be made static or moved into an anonymous namespace to enforce internal linkage [misc-use-internal-linkage]

Suggested change
std::vector<Point> GenerateRandomPoints(size_t count, double min = 0.0,
static std::vector<Point> GenerateRandomPoints(size_t count, double min = 0.0,

@DafeCpp DafeCpp deleted a comment from github-actions Bot May 3, 2025
@DafeCpp DafeCpp deleted a comment from github-actions Bot May 3, 2025
@DafeCpp DafeCpp deleted a comment from github-actions Bot May 3, 2025
@DafeCpp DafeCpp deleted a comment from github-actions Bot May 3, 2025
@DafeCpp DafeCpp deleted a comment from github-actions Bot May 3, 2025
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Comment thread task_07/src/SAH.cpp
@@ -0,0 +1,55 @@
#include <omp.h>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'omp.h' file not found [clang-diagnostic-error]

#include <omp.h>
         ^

Comment thread task_08/src/HashTable.hpp Outdated
class HashTable {
public:
HashTable();
HashTable(std ::vector<int> InputData) : data{InputData} {};
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: parameter 'InputData' is passed by value and only copied once; consider moving it to avoid unnecessary copies [performance-unnecessary-value-param]

task_08/src/HashTable.hpp:0:

- #include <vector>
+ #include <utility>
+ #include <vector>
Suggested change
HashTable(std ::vector<int> InputData) : data{InputData} {};
HashTable(std ::vector<int> InputData) : data{std::move(InputData)} {};

@DafeCpp DafeCpp deleted a comment from github-actions Bot May 3, 2025
@DafeCpp DafeCpp deleted a comment from github-actions Bot May 3, 2025
@DafeCpp DafeCpp deleted a comment from github-actions Bot May 3, 2025
@DafeCpp DafeCpp deleted a comment from github-actions Bot May 3, 2025
@DafeCpp DafeCpp deleted a comment from github-actions Bot May 3, 2025
Comment thread task_07/src/KDtree.cpp Outdated
#include <execution>
#include <stdexcept>

#include "constants.hpp"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

уже добавлен в KDtree.hpp тут лучше удалить

Comment thread task_07/src/KDtree.hpp Outdated
struct Point {
double x;
double y;
Point(double xx, double yy) : x{xx}, y{yy} {}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Point(double xx, double yy) : x{xx}, y{yy} {}
Point(double x, double y) : x{x}, y{y} {}

Comment thread task_07/src/KDtree.cpp Outdated
node->right_child->indices.first = node->indices.first + left_count;
node->right_child->indices.second = node->indices.second;

Ax == axis::Ox ? Ax = axis::Oy : Ax = axis::Ox;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тяжело читается, лучше вот так:

Suggested change
Ax == axis::Ox ? Ax = axis::Oy : Ax = axis::Ox;
Ax = (Ax == axis::Ox) ? axis::Oy : axis::Ox;

Comment thread task_07/src/KDtree.cpp Outdated
}

KDTree::KDTree(std ::vector<Point> points) {
if (points.size() == 0) throw std::invalid_argument{"No Points detected"};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (points.size() == 0) throw std::invalid_argument{"No Points detected"};
if (points.empty()) throw std::invalid_argument{"No Points detected"};

Comment thread task_07/src/KDtree.hpp Outdated
// принадлежащих данной bounding_box [от, до]
};
std::unique_ptr<Node> root;
enum class axis {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Axis

Comment thread task_07/src/KDtree.hpp Outdated
Oy = 1,
};

void split(std::unique_ptr<Node>& node, axis Ax = axis::Ox, int depth = 0);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Split

Comment thread task_07/src/KDtree.cpp Outdated
}

void KDTree::split(std::unique_ptr<Node>& node, axis Ax, int depth) {
std ::pair<double, double> SAH = KDTree::SAH(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

лишний пробел в std ::pair<double, double>

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Comment thread task_07/src/KDtree.cpp
@@ -0,0 +1,98 @@
#include "KDtree.hpp"

#include <omp.h>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'omp.h' file not found [clang-diagnostic-error]

#include <omp.h>
         ^

Comment thread task_07/src/KDtree.cpp

Ax == axis::Ox ? Ax = axis::Oy : Ax = axis::Ox;

if (depth < max_parallel_depth) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: if with identical then and else branches [bugprone-branch-clone]

  if (depth < max_parallel_depth) {
  ^
Additional context

task_07/src/KDtree.cpp:76: else branch starts here

  } else {
    ^

Comment thread task_07/src/KDtree.hpp

bool operator==(const Point& other) const {
constexpr double epsilon = 1e-9;
return (std::abs(x - other.x) < epsilon) &&
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no member named 'abs' in namespace 'std' [clang-diagnostic-error]

    return (std::abs(x - other.x) < epsilon) &&
                 ^

Comment thread task_07/src/KDtree.hpp
bool operator==(const Point& other) const {
constexpr double epsilon = 1e-9;
return (std::abs(x - other.x) < epsilon) &&
(std::abs(y - other.y) < epsilon);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no member named 'abs' in namespace 'std' [clang-diagnostic-error]

           (std::abs(y - other.y) < epsilon);
                 ^

Comment thread task_07/src/KDtree.hpp Outdated
Oy = 1,
};

void split(std::unique_ptr<Node>& node, axis Ax = axis::Ox, int depth = 0);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: enum 'axis' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size [performance-enum-size]

 axis {
 ^

Comment thread task_08/src/HashTable.cpp Outdated
std::vector<Elem> NewData(data.size() * 2, ZeroElem);
std::vector<Elem> OldData = std::move(data);
data = std::move(NewData);
for (auto elem : OldData) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy]

Suggested change
for (auto elem : OldData) {
for (const auto& elem : OldData) {

Comment thread task_08/src/HashTable.cpp Outdated
}
}

void HashTable::add(std::string key, int value) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: the parameter 'key' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]

task_08/src/HashTable.hpp:7:

-   void add(std::string key, int value);
+   void add(const std::string& key, int value);
Suggested change
void HashTable::add(std::string key, int value) {
void HashTable::add(const std::string& key, int value) {

Comment thread task_08/src/HashTable.cpp Outdated
if (EngagedSpace > (data.size() / 2)) Resize();
}

void HashTable::remove(std::string key) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: the parameter 'key' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]

task_08/src/HashTable.hpp:8:

-   void remove(std::string key);
+   void remove(const std::string& key);
Suggested change
void HashTable::remove(std::string key) {
void HashTable::remove(const std::string& key) {

Comment thread task_08/src/HashTable.cpp Outdated
--EngagedSpace;
}

int HashTable::get(std::string key) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: the parameter 'key' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]

task_08/src/HashTable.hpp:9:

-   int get(std::string key);
+   int get(const std::string& key);
Suggested change
int HashTable::get(std::string key) {
int HashTable::get(const std::string& key) {

Comment thread task_08/src/HashTable.hpp
int get(std::string key);

private:
enum struct Label {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: enum 'Label' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size [performance-enum-size]

  enum struct Label {
              ^

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Comment thread task_02/src/stack.hpp
#include <vector>

template <typename T>
concept Comparable = requires(T a, T b) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'T' does not refer to a value [clang-diagnostic-error]

concept Comparable = requires(T a, T b) {
                                   ^
Additional context

task_02/src/stack.hpp:4: declared here

template <typename T>
                   ^

Comment thread task_02/src/stack.hpp

template <typename T>
concept Comparable = requires(T a, T b) {
{ a < b } -> std::convertible_to<bool>;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'T' does not refer to a value [clang-diagnostic-error]

concept Comparable = requires(T a, T b) {
                              ^
Additional context

task_02/src/stack.hpp:4: declared here

template <typename T>
                   ^

Comment thread task_07/src/KDtree.cpp

Ax = (Ax == Axis::Ox) ? Axis::Oy : Axis::Ox;

if (depth < max_parallel_depth) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: if with identical then and else branches [bugprone-branch-clone]

  if (depth < max_parallel_depth) {
  ^
Additional context

task_07/src/KDtree.cpp:74: else branch starts here

  } else {
    ^

Comment thread task_07/src/KDtree.hpp
Oy = 1,
};

void Split(std::unique_ptr<Node>& node, Axis Ax = Axis::Ox, int depth = 0);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: enum 'Axis' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size [performance-enum-size]

 Axis {
 ^

Comment thread task_09/src/TableTask.cpp
@@ -0,0 +1,45 @@
#include "TableTask.hpp"

std::vector<std::string> TaskSolve(int n, int m, int k,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: parameter 'k' is unused [misc-unused-parameters]

Suggested change
std::vector<std::string> TaskSolve(int n, int m, int k,
std::vector<std::string> TaskSolve(int n, int m, int /*k*/,

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 15 out of 17. Check the log or trigger a new build to see more.

Comment thread task_02/src/stack.hpp
#include <vector>

template <typename T>
concept Comparable = requires(T a, T b) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'T' does not refer to a value [clang-diagnostic-error]

concept Comparable = requires(T a, T b) {
                              ^
Additional context

task_02/src/stack.hpp:4: declared here

template <typename T>
                   ^

Comment thread task_02/src/stack.hpp
#include <vector>

template <typename T>
concept Comparable = requires(T a, T b) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: unknown type name 'concept' [clang-diagnostic-error]

concept Comparable = requires(T a, T b) {
^

Comment thread task_02/src/stack.hpp
{ a < b } -> std::convertible_to<bool>;
};

template <Comparable T>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: unknown type name 'Comparable' [clang-diagnostic-error]

template <Comparable T>
          ^

Comment thread task_02/src/stack.hpp
public:
void Push(int value);
int Pop();
void Push(T k);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: unknown type name 'T' [clang-diagnostic-error]

  void Push(T k);
            ^

Comment thread task_02/src/stack.hpp
void Push(int value);
int Pop();
void Push(T k);
T Pop();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: unknown type name 'T' [clang-diagnostic-error]

  T Pop();
  ^

Comment thread task_02/src/stack.hpp
template <Comparable T>
T Stack<T>::Pop() {
if (_data.size() == 0) throw std::out_of_range("No data in stack");
T pop_val{_data.back()};
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: expected ';' after expression [clang-diagnostic-error]

Suggested change
T pop_val{_data.back()};
T; pop_val{_data.back()};

Comment thread task_02/src/stack.hpp
template <Comparable T>
T Stack<T>::Pop() {
if (_data.size() == 0) throw std::out_of_range("No data in stack");
T pop_val{_data.back()};
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use of undeclared identifier 'pop_val' [clang-diagnostic-error]

  T pop_val{_data.back()};
    ^

Comment thread task_02/src/stack.hpp
if (_data.size() == 0) throw std::out_of_range("No data in stack");
T pop_val{_data.back()};
_data.pop_back();
return pop_val;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use of undeclared identifier 'pop_val' [clang-diagnostic-error]

  return pop_val;
         ^

Comment thread task_02/src/stack.hpp
return pop_val;
}

template <Comparable T>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: unknown type name 'Comparable' [clang-diagnostic-error]

template <Comparable T>
          ^

Comment thread task_02/src/stack.hpp
int Pop();
int GetMin();
void Push(T k);
T Pop();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: unknown type name 'T' [clang-diagnostic-error]

  T Pop();
  ^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants